// 引入项目中全部的全局组件
import svgIcon from './svgIcon/index.vue';
import Category from './Category/index.vue';
import uploadDrag from './uploadDrag/index.vue';
import type { App, Component } from 'vue';
// 全局对象
const allGlobalComponents: { [name: string]: Component } = { svgIcon, Category, uploadDrag };
// const allGlobalComponents: any = { svgIcon, Category };

// 对外暴露插件对象
export default {
  install(app: App) {
    //注册项目全部的全局组件
    Object.keys(allGlobalComponents).forEach((key) => {
      //注册为全局组件
      app.component(key, allGlobalComponents[key]);
    });
  },
};
